{extend name="public/base" /}

{block name="content-header"}
<!-- Content Header (Page header) -->
<div class="content-header">
	<div class="container-fluid">
		<div class="row mb-2">
			<div class="col-sm-6">
				<h1 class="m-0 text-dark">SEO设置</h1>
			</div><!-- /.col -->
			<div class="col-sm-6">
				<ol class="breadcrumb float-sm-right">
					<li class="breadcrumb-item"><a href="{:Url('index/index')}">首页</a></li>
					<li class="breadcrumb-item active">SEO设置</li>
				</ol>
			</div><!-- /.col -->
		</div><!-- /.row -->
	</div><!-- /.container-fluid -->
</div>
<!-- /.content-header -->
{/block}

{block name="content-content"}
<!-- Main content -->
<section class="content">
	<div class="container-fluid">
		<div class="row">
			<div class="col-lg-12">
				<div class="card">
					<div class="card-header border-transparent">
						<div class="pull-left">
							<a href="javascript:location.reload();"><button type="button" class="btn btn-sm btn-info"><i class="fa fa-refresh"></i></button></a>
							<a href="javascript:history.go(-1);"><button type="button" class="btn btn-sm btn-info"><i class="fa fa-reply"></i></button></a>
							<a href="{:Url('add')}"><button type="button" class="btn btn-sm btn-success"><i class="fa fa-plus"></i>新增</button></a>
							<button class="btn btn-sm btn-success ajax-post" url="{:Url('changeStatus?method=resume')}" target-form="ids">启 用</button>
							<button class="btn btn-sm btn-warning ajax-post" url="{:Url('changeStatus?method=forbid')}" target-form="ids">禁 用</button>
							<button type="button" class="btn btn-sm btn-danger ajax-post confirm" url="{:Url('changeStatus',['method'=>'delete'])}" target-form="ids"><i class="fa fa-remove"></i>删除</button>
							<button type="button" class="btn btn-sm btn-info list_sort" url="{:Url('sort','','')}"><i class="fa fa-sort"></i>排序</button>
						</div>
					</div>
					<div class="card-body p-0">
						<div class="table-responsive">
							<table class="table m-0">
								<thead>
									<tr>
										<th class="row-selected">
											<input class="checkbox check-all" type="checkbox">
										</th>
										<th>ID</th>
										<th>设置说明</th>
										<th>模块</th>
										<th>控制器</th>
										<th>方法</th>
										<th>SEO标题</th>
										<th>SEO关键词</th>
										<th>SEO描述</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									{notempty name="list"}
									{volist name="list" id="vo"}
									<tr>
										<td><input class="ids row-selected" type="checkbox" name="ids[]" value="{$vo['id']}"> </td>
										<td>{$vo.id}</td>
										<td><a href="{:Url('edit?id='.$vo['id'])}">{$vo.title}</a></td>
										<td>{$vo.module}</td>
										<td>{$vo.controller}</td>
										<td>{$vo.action}</td>
										<td><code>{$vo.seo_title}</code></td>
										<td><code>{$vo.seo_keywords}</code></td>
										<td><code>{$vo.seo_description}</code></td>
										<td>
											<a title="编辑" href="{:Url('edit?id='.$vo['id'])}">编辑</a>
											{eq name="vo.status" value="1"}
											<a href="{:Url('changeStatus?method=forbid&ids='.$vo['id'])}" class="ajax-get">禁用</a>
											{else/}
											<a href="{:Url('changeStatus?method=resume&ids='.$vo['id'])}" class="ajax-get">启用</a>
											{/eq}
											<a class="confirm ajax-get" title="删除" href="{:Url('changeStatus',['method'=>'delete','ids'=>$vo['id']])}">删除</a>
										</td>
									</tr>
									{/volist}
									{else/}
									<td colspan="9" class="text-center"> aOh! 暂时还没有内容! </td>
									{/notempty}
								</tbody>
							</table>
						</div>
						<!-- /.table-responsive -->
					</div>
					<!-- /.card-body -->
					{notempty name="_page"}
					<div class="card-footer clearfix">
						<div class="page">
							{$_page|raw}
						</div>
					</div>
					<!-- /.card-footer -->
					{/notempty}
				</div>
			</div>
		</div>
	</div><!-- /.container-fluid -->
</section>
<!-- /.content -->

<!-- Main content -->
<!-- /.content -->
{/block}

{block name='script'}
<script src="__THEME__/default/view/admin/static/js/common.js?v={:time_version()}"></script>
<script type="text/javascript" charset="utf-8">
//导航高亮
highlight_subnav('{:Url('seo/index')}');
$(function(){
	//点击排序
	$('.list_sort').click(function(){
		var url = $(this).attr('url');
		var ids = $('.ids:checked');
		var param = '';
		if(ids.length > 0){
			var str = new Array();
			ids.each(function(){
				str.push($(this).val());
			});
			param = str.join(',');
		}

		if(url != undefined && url != ''){
			window.location.href = url + '/ids/' + param;
		}
	});
})
</script>
{/block}
